﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using  System.Xml.Serialization;

namespace Business
{
    #region 航变解析PNR请求类
    /// <summary>
    /// 航变解析PNR请求类
    /// </summary>
    [Serializable]
    public class DelayAnalysisPnrRequest
    {
        /// <summary>
        /// 订单号
        /// </summary>
        public int OrderId { get; set; }
        /// <summary>
        /// 乘客Pnr
        /// </summary>
        public string TicketPnr { get; set; }
        /// <summary>
        /// 原订单的起飞机场
        /// </summary>
        public string StartPort { get; set; }
        /// <summary>
        /// 原订单的抵达机场
        /// </summary>
        public string EndPort { get; set; }
        /// <summary>
        /// PNR解析RT过的信息 （BASE64编码过的）
        /// </summary>
        public string PnrInfoData { get; set; }
        /// <summary>
        /// 是否是用PNR解析（true - 是  false - 用PnrInfoData调用接口做解析）
        /// </summary>
        public bool IsPnrAnalysis { get; set; }

        /// <summary>
        ///  航变解析PNR请求构造函数
        /// </summary>
        public DelayAnalysisPnrRequest()
        {
            OrderId = 0;
            TicketPnr = string.Empty;
            PnrInfoData = string.Empty;
            IsPnrAnalysis = false;
        }
    }
    #endregion

    #region 航变解析PNR返回类
    /// <summary>
    /// 航变解析PNR返回类
    /// </summary>
    [Serializable]
    public class DelayAnalysisPnrResponse
    {
        /// <summary>
        /// 是否成功
        /// </summary>
        public bool IsSuc { get; set; }
        /// <summary>
        /// 错误信息
        /// </summary>
        public string ErrorMsg { get; set; }
        /// <summary>
        /// PNR信息
        /// </summary>
        public string Pnr { get; set; }
        /// <summary>
        /// 原航空公司二字码
        /// </summary>
        public string OriAirCompanyCode { get; set; }
        /// <summary>
        /// 原舱位代码
        /// </summary>
        public string OriCabinCode { get; set; }
        /// <summary>
        /// 原航空公司名称
        /// </summary>
        public string OriAirCompanyName { get; set; }
        /// <summary>
        /// 原航班号
        /// </summary>
        public string OriFlightNo { get; set; }
        /// <summary>
        /// 原起飞机场三字码
        /// </summary>
        public string OriStartPortCode { get; set; }
        /// <summary>
        /// 原起飞机场名称
        /// </summary>
        public string OriStartPortName { get; set; }
        /// <summary>
        /// 原抵达机场三字码
        /// </summary>
        public string OriEndPortCode { get; set; }
        /// <summary>
        /// 原抵达机场名称
        /// </summary>
        public string OriEndPortName { get; set; }
        /// <summary>
        /// 原起飞时间
        /// </summary>
        public DateTime OriFlyOffDate { get; set; }
        /// <summary>
        /// 原抵达时间
        /// </summary>
        public DateTime OriArriveDate { get; set; }
        /// <summary>
        /// 新航空公司二字码
        /// </summary>
        public string NewAirCompanyCode { get; set; }
        /// <summary>
        /// 新航空公司名称
        /// </summary>
        public string NewAirCompanyName { get; set; }
        /// <summary>
        /// 新航班号
        /// </summary>
        public string NewFlightNo { get; set; }
        /// <summary>
        /// 新舱位代码
        /// </summary>
        public string NewCabinCode { get; set; }
        /// <summary>
        /// 新起飞机场三字码
        /// </summary>
        public string NewStartPortCode { get; set; }
        /// <summary>
        /// 新起飞机场名称
        /// </summary>
        public string NewStartPortName { get; set; }
        /// <summary>
        /// 新抵达机场三字码
        /// </summary>
        public string NewEndPortCode { get; set; }
        /// <summary>
        /// 新抵达机场名称
        /// </summary>
        public string NewEndPortName { get; set; }
        /// <summary>
        /// 新起飞时间
        /// </summary>
        public DateTime NewFlyOffDate { get; set; }
        /// <summary>
        /// 新抵达时间
        /// </summary>
        public DateTime NewArriveDate { get; set; }
        /// <summary>
        /// 航变类型(1:延迟 2:提前 3:取消 4-解析失败 5:手动添加 6：航变号或者机场或者舱位发生变动)
        /// </summary>
        public int ChangeType { get; set; }
        /// <summary>
        /// PNR解析后的RT信息（BASE64）
        /// </summary>
        public string PnrInfos { get; set; }
        /// <summary>
        /// PNR解析后的RT信息,插入到FlightDelay表中的数据是一样的（BASE64）
        /// </summary>
        public string PnrInfosAddDelayModel { get; set; }
        /// <summary>
        /// 操作人
        /// </summary>
        public string Handler { get; set; }

        /// <summary>
        /// 航变解析PNR返回构造函数
        /// </summary>
        public DelayAnalysisPnrResponse()
        {
            IsSuc = false;
            ErrorMsg = string.Empty;
            Pnr = string.Empty;
            OriAirCompanyCode = string.Empty;
            OriAirCompanyName = string.Empty;
            OriFlightNo = string.Empty;
            OriCabinCode = string.Empty;
            OriStartPortCode = string.Empty;
            OriStartPortName = string.Empty;
            OriEndPortCode = string.Empty;
            OriEndPortName = string.Empty;
            OriFlyOffDate = new DateTime(1900, 1, 1);
            OriArriveDate = new DateTime(1900, 1, 1);
            NewFlightNo = string.Empty;
            NewCabinCode = string.Empty;
            NewStartPortCode = string.Empty;
            NewStartPortName = string.Empty;
            NewEndPortCode = string.Empty;
            NewEndPortName = string.Empty;
            NewFlyOffDate = new DateTime(1900, 1, 1);
            NewArriveDate = new DateTime(1900, 1, 1);
            ChangeType = 0;
            PnrInfos = string.Empty;
            PnrInfosAddDelayModel = string.Empty;
            Handler = string.Empty;
        }
    } 
    #endregion

    #region 修改航变信息请求参数类
    /// <summary>
    /// 修改航变信息请求参数类
    /// </summary>
    [XmlRoot("request")]
    public class UpdateDelayRequest
    {
        /// <summary>
        /// 航变监控Id
        /// </summary>
        public int DelayId { get; set; }
        /// <summary>
        /// 订单Id
        /// </summary>
        public int OrderId { get; set; }
        /// <summary>
        /// PNR信息
        /// </summary>
        public string Pnr { get; set; }
        /// <summary>
        /// 原航空公司二字码
        /// </summary>
        public string OriAirCompanyCode { get; set; }
        /// <summary>
        /// 原舱位代码
        /// </summary>
        public string OriCabinCode { get; set; }
        /// <summary>
        /// 原航空公司名称
        /// </summary>
        public string OriAirCompanyName { get; set; }
        /// <summary>
        /// 原航班号
        /// </summary>
        public string OriFlightNo { get; set; }
        /// <summary>
        /// 原起飞机场三字码
        /// </summary>
        public string OriStartPortCode { get; set; }
        /// <summary>
        /// 原起飞机场名称
        /// </summary>
        public string OriStartPortName { get; set; }
        /// <summary>
        /// 原抵达机场三字码
        /// </summary>
        public string OriEndPortCode { get; set; }
        /// <summary>
        /// 原抵达机场名称
        /// </summary>
        public string OriEndPortName { get; set; }
        /// <summary>
        /// 原起飞时间
        /// </summary>
        public DateTime OriFlyOffDate { get; set; }
        /// <summary>
        /// 原抵达时间
        /// </summary>
        public DateTime OriArriveDate { get; set; }
        /// <summary>
        /// 新航空公司二字码
        /// </summary>
        public string NewAirCompanyCode { get; set; }
        /// <summary>
        /// 新航空公司名称
        /// </summary>
        public string NewAirCompanyName { get; set; }
        /// <summary>
        /// 新航班号
        /// </summary>
        public string NewFlightNo { get; set; }
        /// <summary>
        /// 新舱位代码
        /// </summary>
        public string NewCabinCode { get; set; }
        /// <summary>
        /// 新起飞机场三字码
        /// </summary>
        public string NewStartPortCode { get; set; }
        /// <summary>
        /// 新起飞机场名称
        /// </summary>
        public string NewStartPortName { get; set; }
        /// <summary>
        /// 新抵达机场三字码
        /// </summary>
        public string NewEndPortCode { get; set; }
        /// <summary>
        /// 新抵达机场名称
        /// </summary>
        public string NewEndPortName { get; set; }
        /// <summary>
        /// 新起飞时间
        /// </summary>
        public DateTime NewFlyOffDate { get; set; }
        /// <summary>
        /// 新抵达时间
        /// </summary>
        public DateTime NewArriveDate { get; set; }
        /// <summary>
        /// 航变类型(1:延迟 2:提前 3:取消 4-解析失败 5:手动添加 6：航变号或者机场或者舱位发生变动)
        /// </summary>
        public int ChangeType { get; set; }
        /// <summary>
        /// PNR解析后的RT信息,插入到FlightDelay表中的数据是一样的（BASE64）
        /// </summary>
        public string PnrInfosAddDelayModel { get; set; }
        /// <summary>
        /// 操作人
        /// </summary>
        public string Handler { get; set; }

        /// <summary>
        /// 航变解析PNR返回构造函数
        /// </summary>
        public UpdateDelayRequest()
        {
            DelayId = 0;
            Pnr = string.Empty;
            OriAirCompanyCode = string.Empty;
            OriAirCompanyName = string.Empty;
            OriFlightNo = string.Empty;
            OriCabinCode = string.Empty;
            OriStartPortCode = string.Empty;
            OriStartPortName = string.Empty;
            OriEndPortCode = string.Empty;
            OriEndPortName = string.Empty;
            OriFlyOffDate = new DateTime(1900, 1, 1);
            OriArriveDate = new DateTime(1900, 1, 1);
            NewFlightNo = string.Empty;
            NewCabinCode = string.Empty;
            NewStartPortCode = string.Empty;
            NewStartPortName = string.Empty;
            NewEndPortCode = string.Empty;
            NewEndPortName = string.Empty;
            NewFlyOffDate = new DateTime(1900, 1, 1);
            NewArriveDate = new DateTime(1900, 1, 1);
            ChangeType = 0;
            PnrInfosAddDelayModel = string.Empty;
            Handler = string.Empty;
        }
    } 
    #endregion

    #region 修改航变信息返回参数类
    /// <summary>
    /// 修改航变信息返回参数类
    /// </summary>
    [XmlRoot("response")]
    public class UpdateDelayResponse
    {
        /// <summary>
        /// 是否成功
        /// </summary>
        public bool IsSuc { get; set; }
        /// <summary>
        /// 错误信息
        /// </summary>
        public string ErrorMsg { get; set; }

        /// <summary>
        /// 修改航变信息返回参数类构造函数
        /// </summary>
        public UpdateDelayResponse()
        {
            IsSuc = false;
            ErrorMsg = string.Empty;
        }
    } 
    #endregion

}
